package org.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller//告诉spring这是一个controller并且注册到容器里
public class HelloController {

    @RequestMapping("/hello")
    @ResponseBody//让返回的数据变为json格式
    public String hello(){
        return "hello";
    }
}
